package cc.monggo.web.form;

import java.util.Date;

import cc.monggo.domain.BaseUser;
import cc.monggo.domain.XThirdUser;

public class RegisterForm extends BaseForm {
	//用户信息
	private BaseUser baseUser;
	private String userName;
	private String password;
	private String realName;
	private String email;
	private String sex;
	
	private String phone;

	// 第三方用户信息
	private XThirdUser xThirdUser;
	private String uId;
	private String userId;
	private String type;
	private String thirdId;
	private String nickname;

	private String accessToken;
	private String expiresin;
	private String lastTime;
	private String imageUrlSmall;
	private String imageUrlLarge;
	
	private String addTime;
	
	public BaseUser getBaseUser() {
		return baseUser;
	}

	public void setBaseUser(BaseUser baseUser) {
		this.baseUser = baseUser;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public XThirdUser getxThirdUser() {
		return xThirdUser;
	}

	public void setxThirdUser(XThirdUser xThirdUser) {
		this.xThirdUser = xThirdUser;
	}

	public String getuId() {
		return uId;
	}

	public void setuId(String uId) {
		this.uId = uId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getThirdId() {
		return thirdId;
	}

	public void setThirdId(String thirdId) {
		this.thirdId = thirdId;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public String getExpiresin() {
		return expiresin;
	}

	public void setExpiresin(String expiresin) {
		this.expiresin = expiresin;
	}

	public String getLastTime() {
		return lastTime;
	}

	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}

	public String getImageUrlSmall() {
		return imageUrlSmall;
	}

	public void setImageUrlSmall(String imageUrlSmall) {
		this.imageUrlSmall = imageUrlSmall;
	}

	public String getImageUrlLarge() {
		return imageUrlLarge;
	}

	public void setImageUrlLarge(String imageUrlLarge) {
		this.imageUrlLarge = imageUrlLarge;
	}

	public String getAddTime() {
		return addTime;
	}

	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}

	@Override
	public void form2Domain() {
	}
	
	public void form2BaseUser(){
		BaseUser baseUser = new BaseUser();
		baseUser.setUserName(getUserName());
		baseUser.setPassword(getPassword());
		baseUser.setEmail(getEmail());
		baseUser.setRealName(getRealName());
		baseUser.setSex(getSex());
		
		baseUser.setPhone(getPhone());	
		setBaseUser(baseUser);
	}
	
	public void form2XThirdUser(){
		XThirdUser xThirdUser = new XThirdUser();
		xThirdUser.setThirdId(getThirdId());
		xThirdUser.setNickName(getNickname());
		xThirdUser.setAccessToken(getAccessToken());
		xThirdUser.setExpiresin(Long.valueOf(getExpiresin()));
		xThirdUser.setImageUrlSmall(getImageUrlSmall());
		
		xThirdUser.setImageUrlLarge(getImageUrlLarge());
		xThirdUser.setType(getType());
		setxThirdUser(xThirdUser);
	}
	
	@Override
	public void domain2Form() {
		// TODO Auto-generated method stub
		
	}

}